﻿//===================================================================
// 西交通开发框架-XCI.Parent 2019 版权所有     
//===================================================================
using System;
using System.ComponentModel.DataAnnotations;
using XCI.Data.Entity;

namespace XCI.Sys.Model
{
    /// <summary>
    /// 系统角色
    /// </summary>
    [Table("系统角色")]
    public class SysRole
    {
        /// <summary>
        /// 角色主键
        /// </summary>
        [Primary]
        [Column("角色主键", false)]
        public string Id { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        [Column("角色名称")]
        [Required(ErrorMessage = "请输入角色名称")]
        [StringLength(100, ErrorMessage = "角色名称不能超过100个字符")]
        public string Name { get; set; }

        /// <summary>
        /// 角色编码
        /// </summary>
        [Column("角色编码")]
        [Required(ErrorMessage = "请输入角色编码")]
        [StringLength(100, ErrorMessage = "角色编码不能超过100个字符")]
        public string Code { get; set; }

        /// <summary>
        /// 角色名称简拼
        /// </summary>
        [Column("角色名称简拼", false)]
        [StringLength(100, ErrorMessage = "角色名称简拼不能超过100个字符")]
        public string Spell { get; set; }

        /// <summary>
        /// 部门主键
        /// </summary>
        [Column("部门主键",false)]
        public string DeptId { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [Column("部门名称")]
        [Required(ErrorMessage = "请输入部门名称")]
        [StringLength(100, ErrorMessage = "部门名称不能超过100个字符")]
        public string DeptName { get; set; }

        /// <summary>
        /// 状态(0:禁用;1:启用)
        /// </summary>
        [Column("状态")]
        public bool? Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Column("备注")]
        [StringLength(500, ErrorMessage = "备注不能超过500个字符")]
        public string Remark { get; set; }

        /// <summary>
        /// 复制对象
        /// </summary>
        public SysRole Clone()
        {
            return (SysRole)MemberwiseClone();
        }
    }
}
